package com.chengxiaoxiao.utils;

import sun.misc.BASE64Encoder;

import java.security.MessageDigest;

public class MD5Util {

	public static String encode(String password) {
		try{
			MessageDigest md = MessageDigest.getInstance("md5");
			byte b[] = md.digest(password.getBytes());
			return new BASE64Encoder().encode(b);
		}catch(Exception e){
			throw new RuntimeException(e);
		}
	}

}
